import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { KnowledgeConfigVO, KnowledgeConfigForm, KnowledgeConfigQuery } from '@/api/aiqa/knowledgeConfig/types';

/**
 * 查询知识库配置11列表
 * @param query
 * @returns {*}
 */

export const listKnowledgeConfig = (query?: KnowledgeConfigQuery): AxiosPromise<KnowledgeConfigVO[]> => {
  return request({
    url: '/aiqa/knowledgeConfig/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询知识库配置11详细
 * @param id
 */
export const getKnowledgeConfig = (id: string | number): AxiosPromise<KnowledgeConfigVO> => {
  return request({
    url: '/aiqa/knowledgeConfig/' + id,
    method: 'get'
  });
};

/**
 * 新增知识库配置11
 * @param data
 */
export const addKnowledgeConfig = (data: KnowledgeConfigForm) => {
  return request({
    url: '/aiqa/knowledgeConfig',
    method: 'post',
    data: data
  });
};

/**
 * 修改知识库配置11
 * @param data
 */
export const updateKnowledgeConfig = (data: KnowledgeConfigForm) => {
  return request({
    url: '/aiqa/knowledgeConfig',
    method: 'put',
    data: data
  });
};

/**
 * 删除知识库配置11
 * @param id
 */
export const delKnowledgeConfig = (id: string | number | Array<string | number>) => {
  return request({
    url: '/aiqa/knowledgeConfig/' + id,
    method: 'delete'
  });
};
